
import React, { Component } from 'react'

// 加载样式
import style from './index.scss'

//加载组件
import { Checkbox } from 'antd-mobile'
import common from '../../utils/common'

//定义
// const AgreeItem = Checkbox.AgreeItem;

export default class OrderList extends Component {
    constructor(props) {
        super(props);
        this.state = {
           isToPay: ''
        };
    }
    componentWillMount() {
        let data = this.props.data
    }

    render() {
        let data = this.props.data;
        
        return (
            <div className={style.orderList}>
                <div className={style.container} onClick={()=>{this.toUrl('passInformation/enCode',data)}}>
                    <div className={style.example+' '+'border_bottom_1'}>
                        <div className={style.type}>
                            <span>{data.orderTitle}</span>
                        </div>
                        <div className={style.priceBox}>
                            <div style={
                                !common.isToPay(data.carNumber&&data.carNumber.substring(0,2),data.address&&data.address.cityId)?{display: 'none'}:{}
                            }>
                                <div className={style.price}>
                                    <span>车主姓名</span>
                                    <span>{data.cardName}</span>
                                </div>
                                <div className={style.price}>
                                    <span>身份证号</span>
                                    <span>{data.cardNum}</span>
                                </div>
                                <div className={style.price}>
                                    <span>手机号码</span>
                                    <span>{data.telephone}</span>
                                </div>
                                <div className={style.price} style={{height: '.6rem',lineHeight: '.6rem'}}>
                                    <span>手持身份证照片</span>
                                    <span><img src={data.cardPicture} alt=""/></span>
                                </div>
                                <div className={style.price} style={{height: '.6rem',lineHeight: '.6rem'}}>
                                    <span>交强险保单副本</span>
                                    <span><img src={data.policyPicture} alt=""/></span>
                                </div>
                            </div>
                           
                            <div className={style.price}>
                                <span>六年内新车免检服务</span>
                                <span>￥{data.serviceFee/100||''}</span>
                            </div>
                        </div>
                    </div>
                    <div className={style.example+' '+'border_bottom_1'}>
                        <div className={style.total}>
                            <span>合计</span>
                            <span>￥{data.serviceFee/100||''}</span>
                        </div>
                    </div>

                    <div className={style.example}>
                        <div className={style.address}>
                            <div><span>收件人：{data.address&&data.address.contactName}，{data.address&&data.address.cellNum}</span></div>
                            <div>{data.address&&data.address.fullAddr.replace(null,'')}</div>
                        </div>
                    </div>
                </div>
            </div>

        );
    }
}
//使用context
OrderList.contextTypes = {
	router: React.PropTypes.object.isRequired
};


OrderList.defaultProps = {
    data: {
        address:{}
    }
};